{extend name="public/base"/}
{block name="style"}
<script type="text/javascript" src="/public/lboyue/m/sitejs/book.js?v=20181123"></script>
<script type="text/javascript">

    $(document).ready(function () {


        $('.moreIco').click(function () {

            if($(this).hasClass('closeIco')){

                $('#header').removeClass('app_headerFixed2');
                $(this).removeClass('closeIco');
                $('.app_header_second').hide();
                $('.app_meskSection').hide();

            }else{

                $('#header').addClass('app_headerFixed2');
                $(this).addClass('closeIco');
                $('.app_header_second').show();
                $('.app_meskSection').show();
            }



        })

        $('body').on('click','.app_meskSection',function () {
            $('.app_header_second').hide();
            $('.app_meskSection').hide();
            $('#header').removeClass('app_headerFixed2');
            $('.moreIco').removeClass('closeIco');
        })
    })

</script>
{/block}
{block name="body"}
<div class="app_goBackToTop"></div>
<div class="app_meskSection"></div>

<div class="container">

    <div class="app_header_section2  app_scrollerHeader" id="header">
        <div class="app_header_detail2">
            <div class="app_header_back"></div>
            <div class="app_header_h1">
                书籍详情                <a href="/personal/bookcase"> <i class="shujiaIco"></i></a>
                <i class="moreIco"></i>
            </div>
        </div>
		{include file="public/dropnav" /}
		   </div>



    <div class="app_body">
        
    <div class="app_listBlock app_deleteMargin">
        <div class="app_listBlock_con3">
            <ul class="app_deletePadding">
                <li class="deleteLine">
                    <a href="">
                        <div class="leftImage"><img src="{$cover}" onerror="javascript:this.src='/public/novel/images/default.jpg';"/></div>
                        <div class="rightBlock">
                            <span class="rightBlock_title">{$title}</span>

                            <span class="rightBlock_page2  app_newStyle2">
                                <span class="rightBlock_pageLi">作者：{$author}</span>
                                <span class="rightBlock_pageLi">分类：{$category_id|get_category=###,'title'}</span>
                                <span class="rightBlock_pageLi">字数：{$size/10000|round=###,1}万</span>
                                <span class="rightBlock_success{$fullflag==1?2:3}"></span>
                            </span>
                        </div>
                    </a>
                </li>
            </ul>
        </div>

        <div class="app_conButton">
            <ul>
                <li class="active">
					{if $historylog}
						<a href="/chapter/read/{$bookid}/{$historylog.chapterid}"><span>开始阅读</span></a>

					{else}
						<a href="/chapter/read/{$bookid}/{$previd}"><span>免费试读</span></a>
					{/if}
                    
                </li>
                                                        <li>
                        <a href="/pay/index?type=498"><span>开通VIP</span></a>
                    </li>
                                                    <li>
                    <a id="isbookshelf"><span onclick="addbookshelf()"></span></a>
                </li>
            </ul>
        </div>
        <div class="app_detailNotice"><a href="/chapter/read/{$bookid}/{$previd}">拜金女嫌弃男友穷酸，结果男友居然是…</a></div>
    </div>

    <div class="app_briefIntroduction">
        <div class=" app_listBlock_title  tit_icon1"><span class="h1">简介</span></div>
        <div class="app_cons">
            
            <span class="lis " style="display:block">
                {$intro_s}            </span>

        </div>
    </div>

            <div class="app_hotBlock">
        <div class="app_listBlock_title  tit_icon1">
            <span class="h1">本书标签</span>
            <!--<a class="more" href="">更多</a>-->
        </div>
        <div class="app_hotBlock_lis">
			 {$keywords}
        </div>
    </div>
    

    <div class="app_catalogBlock">
        <div class="app_listBlock_title  tit_icon1">
            <span class="h1">目录<i>（共计{$chapters}章）</i></span>
        </div>

        <div class="app_catalogList2">
            <ul>
                <li>
                    <a href="/book/chapter/{$bookid}">
                        <span class="content">最新章节：{$chapter.chaptername}</span>
                        <span class="time">{$chapter.update_time|date='Y-m-d',###}</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>




    <div class="app_listBlock">

        <div class="app_listBlock_title tit_icon1">
            <span class="h1">打赏</span>
            <a href="/book/bookbonus?bookid={$bookid}&bonusid=0" class="app_edit">我要打赏</a>
        </div>

        <a href="/book/bookbonus?bookid={$bookid}&bonusid=0"><div class="allAward">收到打赏:  &nbsp;{$sumbonus}{:config('virtualname')}</div></a>

        <div class="app_allAward_list">
            <ul>
				{volist name="bonusconfig" id="vo"}
					<li>
                        <a href="/book/bookbonus?bookid={$bookid}&bonusid={$key}">
                        <span class="ico"><img src="{$vo.imgfile}" alt="" /></span>
                        <span class="font">{$vo.caption}</span>
                        <span class="font">{$vo.price}</span>
                        </a>
                    </li>
				{/volist}
            </ul>
        </div>

    </div>

    <div class="app_comment">
        <div class="app_listBlock_title tit_icon1">
            <span class="h1">评论<i>（{$review_count}）</i></span>
            <a href="/book/commit?bookid={$bookid}" class="app_edit">我要评论</a>
        </div>
                <div class="app_comment_list">
            <ul>
			
				{volist name="review" id="vo"}
                <li>
                        <span class="userHeader"><a href=""><img src="{$vo.avatar}" /></a></span>
                        <div class="contentList">
                            <div class="userName">{$vo.username}</div>
                            <div class="userContent">{$vo.content|reviewcontent_replace}</div>
                        </div>
                        <div class="bottom">
                            <span class="time">{$vo.create_time}</span>
                            <a href="/book/replies?bookid={$bookid}&reviewid={$vo.id}"><span class="commentNum"></span></a>
                        </div>
                        
                </li>
				{/volist}
            </ul>
        </div>
        <div class="app_pinglun"><a href="/book/commit?bookid={$bookid}"><i>更多评论</i></a></div>
            </div>

        <div class="app_listBlock ">
        <div class="app_listBlock_title  tit_icon1">
            <span class="h1">大家都在看</span>
        </div>
        <div class="app_listBlock_con">
            <ul>

				{volist name="likebook" id="vo"}
			
					<li>
							<a href="{:url('/book/info',['id'=>$vo.id])}">
								<div class="leftImage"><img src="{$vo.cover}" onerror="javascript:this.src='/public/novel/images/default.jpg';"/></div>
								<div class="rightBlock">
									<span class="rightBlock_title">{$vo.title}</span>
									<span class="rightBlock_con">
									 <span class="con">{$vo.intro}...</span>
							</span>
									<span class="rightBlock_label">
								<span class="keyWord_l">
									   <i class="k1">{$vo['fullflag']==1?"完结":"连载中"}完结</i>
								</span>
								<span class="keyWord_r">
									   <i class="k1">{$vo.size/10000|round=###,1}万字</i>
									   <i class="k2">{$vo.category| get_category=###,'title'}</i>
								</span>
							</span>
								</div>
							</a>
					</li>
				{/volist}
				</ul>
        </div>



    </div>

    
            <div class="app_listBlock">
        <div class="app_listBlock_title  tit_icon1">
            <span class="h1">读过本书的人还读过</span>
            <!--<a class="more" href="">更多</a>-->
        </div>
        <div class="app_listBlock_con2">
            <ul id="dajiadouzaikan">
               
            </ul>
        </div>


    </div>

	{block name="include"}{include file="public:footer" /}{/block}
</div>

{/block}
{block name="script"}
   <script type="text/javascript" src="/public/lboyue/m/js/libs/jquerybase64.js"></script>
    <script type="text/javascript" src="/public/lboyue/m/js/libs/jquery.cookie.js"></script>
    
    <script type="text/javascript">
        var bookid = "{$bookid}";
        var chapterid = 0;
        var domain = "{$Think.config.web_pc_url|str_replace="http://www","",###}";
        var DeveloperMode = "";


        // 检测书籍是否在书架
        if (bookselfdata(bookid, chapterid, 1, domain)) {
            $("#isbookshelf span").text("已在书架");
            $("#isbookshelf span").addClass("noClick");
            $("#isbookshelf span").removeAttr('onclick');
        } else {
            $("#isbookshelf span").text("加入书架");
        }

        // 加入书架
        function addbookshelf() {
            var result = bookselfdata(bookid, chapterid, 2, domain);
            result = parseInt(result);
            switch (result) {
                case 1:
                    $("#isbookshelf span").text("已在书架");
                    $("#isbookshelf span").addClass("noClick");
                    malert("加入书架成功，可在书架查看");
                    break;
                case 1:
                    malert("加入书架失败");
                    return "";
                    break;
            }
        }
		
		$(function(){
			$.ajax({
                url      : "/api/novel/getrand",
                type     : "GET",
                dataType : "json",
                data     : {"limit":3},
                success  : function (re) {
                    var code = re.code;
                    switch (code)
                    {
                        case 1:
                            var data = re.data;
							
                            var html = "";
                            for (var i=0; i < data.length; i++) {
                                html +='<li>                        <a href="/book/info/id/'+data[i].id+'/">                            <span class="img"><img src="'+data[i].cover+'"  onerror="javascript:this.src=\'/public/novel/images/default.jpg\';"></span>                            <span class="name">'+data[i].title+'</span>                        </a>                </li>';
                            }
							console.log(html);
                            $("#dajiadouzaikan").html(html);
                            break;
                        default:
                            malert(re.msg, 1200, 2);
                            break;
                    }
                },
                error    : function () {
                    malert("服务器开小差了～", 1200, 2);
                    return "";
                }
            });
		
		})
        
    </script>
{/block}


